<%@ Language=VBSCRIPT %>
<!--#include file="functions.asp" -->
<%

  dim cn
  dim sql
  dim vendName
  dim rs
  
  sql="SELECT ISNULL(COUNT(*),0) FROM POHEADER WHERE PONUM ='" & request.querystring("PONUM") &"'"
  sql=sql & " AND VENDORID='" & request.querystring("fld") & "'"
  set rs=cn.execute(sql)
  
  if (rs(0)=0) then
  
%>
<SCRIPT language="JavaScript">
//window.opener.<%= request.querystring("fld")%>.value='';
//window.opener.<%= request.querystring("fld")%>.focus();
var url_source="error_msg.html";
var arg="Vendor and PO/SO/CO Not Match!!!";
var modal_dim="dialogWidth:360px; dialogHeight:160px; center:yes; status:no; location:no;";
var x = window.showModalDialog(url_source,arg,modal_dim);
window.opener.<%= request.querystring("src")%>.focus();
window.opener.<%= request.querystring("src")%>.select();
window.close();
</SCRIPT> 
<% else %>

<SCRIPT language="JavaScript">
//var querystring = '<%= request.querystring("fld")%>' ;
//window.opener.<%= request.querystring("fld")%>.value='<%= vendName %>';
//window.opener.<%= request.querystring("fld")%>.focus();
window.close();

</SCRIPT>
<% end if 
cn.close %>

